import http from "@/utils/http";
import { AxiosRequestConfig } from "axios";

export interface DeleteMetricsAnswer_ {
  /**
   * @description 主键id
   * @format int32
   * @example 1
   */
  id: number;
}
export interface PutMetricsAnswerCancelTop_ {
  /**
   * @description 主键id
   * @format int32
   * @example 1
   */
  id: number;
}
export interface PutMetricsAnswerTop_ {
  /**
   * @description 主键id
   * @format int32
   * @example 1
   */
  id: number;
}

export class MetricsAnswer {
  /**
   * 回复问题
   *
   * @tags 指标回复
   * @request POST: /metrics-answer
   * @secure
   */
  postMetricsAnswer = (dto: defs.MetricsAnswerDTO, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-answer`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 删除回复信息
   *
   * @tags 指标回复
   * @request DELETE: /metrics-answer
   * @secure
   */
  deleteMetricsAnswer = (query: { id: number } | DeleteMetricsAnswer_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-answer`,
      method: "DELETE",
      params: query,
      ...params,
    });

  /**
   * 恢复
   *
   * @tags 指标回复
   * @request PUT: /metrics-answer/cancel-top
   * @secure
   */
  putMetricsAnswerCancelTop = (query: { id: number } | PutMetricsAnswerCancelTop_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-answer/cancel-top`,
      method: "PUT",
      params: query,
      ...params,
    });

  /**
   * 置顶
   *
   * @tags 指标回复
   * @request PUT: /metrics-answer/top
   * @secure
   */
  putMetricsAnswerTop = (query: { id: number } | PutMetricsAnswerTop_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityBoolean>({
      url: `/metrics-answer/top`,
      method: "PUT",
      params: query,
      ...params,
    });
}

export default new MetricsAnswer();
